home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SEND C Library Procedures SEND
-
-
-
- NNAAMMEE
- send, sendto, sendmsg - send a message from a socket
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
- ##iinncclluuddee <<ssyyss//ssoocckkeett..hh>>
-
- cccc == sseenndd((ss,, mmssgg,, lleenn,, ffllaaggss))
- iinntt cccc,, ss;;
- cchhaarr **mmssgg;;
- iinntt lleenn,, ffllaaggss;;
-
- cccc == sseennddttoo((ss,, mmssgg,, lleenn,, ffllaaggss,, ttoo,, ttoolleenn))
- iinntt cccc,, ss;;
- cchhaarr **mmssgg;;
- iinntt lleenn,, ffllaaggss;;
- ssttrruucctt ssoocckkaaddddrr **ttoo;;
- iinntt ttoolleenn;;
-
- cccc == sseennddmmssgg((ss,, mmssgg,, ffllaaggss))
- iinntt cccc,, ss;;
- ssttrruucctt mmssgghhddrr **mmssgg;;
- iinntt ffllaaggss;;
-
- DDEESSCCRRIIPPTTIIOONN
- _S_e_n_d, _s_e_n_d_t_o, and _s_e_n_d_m_s_g are used to transmit a message to
- another socket. _S_e_n_d may be used only when the socket is in
- a _c_o_n_n_e_c_t_e_d state, while _s_e_n_d_t_o and _s_e_n_d_m_s_g may be used at
- any time.
-
- The address of the target is given by _t_o with _t_o_l_e_n specify-
- ing its size. The length of the message is given by _l_e_n.
- If the message is too long to pass atomically through the
- underlying protocol, then the error EMSGSIZE is returned,
- and the message is not transmitted.
-
- No indication of failure to deliver is implicit in a _s_e_n_d.
- Return values of -1 indicate some locally detected errors.
-
- If no messages space is available at the socket to hold the
- message to be transmitted, then _s_e_n_d normally blocks, unless
- the socket has been placed in non-blocking I/O mode. The
- _s_e_l_e_c_t(2) call may be used to determine when it is possible
- to send more data.
-
- The _f_l_a_g_s parameter may include one or more of the follow-
- ing:
-
- #define MSG_OOB 0x1 /* process out-of-band data */
- #define MSG_DONTROUTE 0x4 /* bypass routing, use direct interface */
- The flag MSG_OOB is used to send "out-of-band" data on sock-
- ets that support this notion (e.g. SOCK_STREAM); the
-
-
-
- Sprite v1.0 July 21, 1987 1
-
-
-
-
-
-
- SEND C Library Procedures SEND
-
-
-
- underlying protocol must also support "out-of-band" data.
- MSG_DONTROUTE is usually used only by diagnostic or routing
- programs.
-
- See _r_e_c_v(2) for a description of the _m_s_g_h_d_r structure.
-
- RREETTUURRNN VVAALLUUEE
- The call returns the number of characters sent, or -1 if an
- error occurred.
-
- EERRRROORRSS
- [EBADF] An invalid descriptor was specified.
-
- [ENOTSOCK] The argument _s is not a socket.
-
- [EFAULT] An invalid user space address was speci-
- fied for a parameter.
-
- [EMSGSIZE] The socket requires that message be sent
- atomically, and the size of the message
- to be sent made this impossible.
-
- [EWOULDBLOCK] The socket is marked non-blocking and
- the requested operation would block.
-
- [ENOBUFS] The system was unable to allocate an
- internal buffer. The operation may
- succeed when buffers become available.
-
- [ENOBUFS] The output queue for a network interface
- was full. This generally indicates that
- the interface has stopped sending, but
- may be caused by transient congestion.
-
- SSEEEE AALLSSOO
- fcntl(2), recv(2), select(2), getsockopt(2), socket(2),
- write(2)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v1.0 July 21, 1987 2
-
-
-
-